﻿using Fantasy;
using Fantasy.Async;
using Fantasy.Entitas.Interface;
using Fantasy.Event;
using UnityEngine;

namespace Hotfix.Entity
{
    public class User : Fantasy.Entitas.Entity
    {
        public string Name { get; set; }
    }

    public class UsreAge : Fantasy.Entitas.Entity
    {
        public int Age { get; set; }
    }

    public class UserAwake : AwakeSystem<User>
    {
        protected override void Awake(User self)
        {
            Log.Debug("UserAwake");
        }
    }

    public class UserUpdate : UpdateSystem<User>
    {
        protected override void Update(User self)
        {
            // Log.Debug("UserUpdate");
        }
    }

    public class UserDestroy : DestroySystem<User>
    {
        protected override void Destroy(User self)
        {
            Log.Debug("UserDestroy");
        }
    }

    public class UserDeserialize : DeserializeSystem<User>
    {
        protected override void Deserialize(User self)
        {
            Log.Debug("UserDeserialize");
        }
    }

    public class OnUserLogin : EventSystem<User>
    {
        protected override void Handler(User self)
        {
            Log.Debug("OnUserLogin");
        }
    }

    public class OnUserLogout : AsyncEventSystem<User>
    {
        protected override async FTask Handler(User self)
        {
            Log.Debug("OnUserLoginAsync");
            await FTask.CompletedTask;
        }
    }
}